Skip Headers

Oracle® OLAP Reference 10g Release 2 (10.2) Part Number B14350-01 |
Home | Book List | Contents | Index | Master Index | Feedback

Previous | Next
| View PDF

# Embedding OLAP DML in SQL Statements

With the `DBMS_AW` package you can perform the full range of OLAP processing within analytic workspaces. You can import data from legacy workspaces, relational tables, or flat files. You can define OLAP objects and perform complex calculations.

Note: If you use the `DBMS_AW` package to create analytic workspaces from scratch, you may not be able to use OLAP utilities, such as Analytic Workspace Manager and the `DBMS_AW` Aggregate Advisor, which require standard form.

## Methods for Executing OLAP DML Commands

The `DBMS_AW` package provides several procedures for executing ad hoc OLAP DML commands. Using the `EXECUTE` or `INTERP_SILENT` procedures or the `INTERP` or `INTERCLOB` functions, you can execute a single OLAP DML command or a series of commands separated by semicolons.

Which procedures you use will depend on how you want to direct output and on the size of the input and output buffers. For example, the `EXECUTE` procedure directs output to a printer buffer, the `INTERP_SILENT` procedure suppresses output, and the `INTERP` function returns the session log.

The `DBMS_AW` package also provides functions for evaluating OLAP expressions. The `EVAL_TEXT` function returns the result of a text expression, and `EVAL_NUMBER` returns the result of a numeric expression.

See Also: Oracle OLAP DML Reference for complete information about OLAP DML expressions. Do not confuse the `DBMS_AW` functions `EVAL_NUMBER` and `EVAL_TEXT` with the SQL function `OLAP_EXPRESSION`. See Chapter 30, "OLAP_EXPRESSION" for more information.

## Guidelines for Using Quotation Marks in OLAP DML Commands

The SQL processor evaluates the embedded OLAP DML commands, either in whole or in part, before sending them to Oracle OLAP for processing. Follow these guidelines when formatting the OLAP DML commands in the `olap-commands` parameter of `DBMS_AW` procedures:

- Wherever you would normally use a single quote (`'`) in an OLAP DML command, use two single quotes (`''`). The SQL processor strips one of the single quotes before it sends the OLAP DML command to Oracle OLAP.

- In the OLAP DML, a double quote (`"`) indicates the beginning of a comment.